package com.example.hm_dtfkz.util;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;

import com.example.hm_dtfkz.BuildConfig;

public class AppUtils {

    public static String getAppName(Context context) {
        PackageManager packageManager = context.getPackageManager();
        String appName = "";
        try {
            ApplicationInfo applicationInfo = packageManager.getApplicationInfo(context.getPackageName(), 0);
            appName = (String) packageManager.getApplicationLabel(applicationInfo);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
            appName = "Unknown";
        }
        return appName;
    }

    public static  class WK{
        //体力
        public static String PHYSICAL_STIMULATION="0F6386BD40EDFD6B1409A7BF979850C6";
        //转盘
        public static String TURNTABLE="96B367845E36BBAFBE34ED67D7F63781";
        //提现
        public static String WITHDRAWAL="4F6B4E8B71DC409875FF539214E0A81D";
        //红包
        public static String RED_ENVELOPE="5A87F8BBC66EB241D94B5410DEACFB8A";
        //开屏
        public static String SPREAD_ITS_TAIL="D52FB11EB0201F52C6CDEA42FAB49047";

    }

    public static  class CC{
        //体力
        public static String PHYSICAL_STIMULATION="894408C9C66037814190E9F07ACAB680";//
        //转盘
        public static String TURNTABLE="711DF9F2B93CA229B4FAADCED8EE18AB";//
        //提现
        public static String WITHDRAWAL="0CB581FBEE2121861E0E689EF29FFC7A";//
        //红包
        public static String RED_ENVELOPE="711DF9F2B93CA229B4FAADCED8EE18AB";//
        //开屏
        public static String SPREAD_ITS_TAIL="7CC1E0B1A4A58DBC8D9575EC1800D985";//

    }

    public static  class BIL{
        //体力
        public static String PHYSICAL_STIMULATION="894408C9C66037814190E9F07ACAB680";//
        //转盘
        public static String TURNTABLE="711DF9F2B93CA229B4FAADCED8EE18AB";//
        //提现
        public static String WITHDRAWAL="0CB581FBEE2121861E0E689EF29FFC7A";//
        //红包
        public static String RED_ENVELOPE="711DF9F2B93CA229B4FAADCED8EE18AB";//
        //开屏
        public static String SPREAD_ITS_TAIL="7CC1E0B1A4A58DBC8D9575EC1800D985";//

    }

    public  static String  getADID(int type){
        String adid="";
        switch (type){
            case 1:
                if(BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.WUKONG)){
                    adid=AppUtils.WK.PHYSICAL_STIMULATION;
                } else if (BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.CC)) {
                    adid=AppUtils.CC.PHYSICAL_STIMULATION;
                }else if(BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.BILL)) {
                    adid=AppUtils.BIL.PHYSICAL_STIMULATION;
                }
                break;
            case 2:
                if(BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.WUKONG)){
                    adid=AppUtils.WK.TURNTABLE;
                } else if (BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.CC)) {
                    adid=AppUtils.CC.TURNTABLE;
                }else if(BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.BILL)) {
                    adid=AppUtils.BIL.TURNTABLE;
                }
                break;
            case 3:
                if(BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.WUKONG)){
                    adid=AppUtils.WK.WITHDRAWAL;
                } else if (BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.CC)) {
                    adid=AppUtils.CC.WITHDRAWAL;
                }else if(BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.BILL)) {
                    adid=AppUtils.BIL.WITHDRAWAL;
                }
                break;
            case 4:
                if(BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.WUKONG)){
                    adid=AppUtils.WK.RED_ENVELOPE;
                } else if (BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.CC)) {
                    adid=AppUtils.CC.RED_ENVELOPE;
                }else if(BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.BILL)) {
                    adid=AppUtils.BIL.RED_ENVELOPE;
                }
                break;
        }


        return adid;
    }

    public  static String  getAPPId(){
        String adid="2598C778FDB9B33F";
        if(BuildConfig.APPLICATION_ID.equals(APPTYPE.WUKONG)){
            adid="2598C778FDB9B33F";
        } else if (BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.CC)) {
            adid="9B09CA5C51B20771";
        }else if(BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.BILL)) {
            adid="";//未申请
        }

        return adid;
    }

    public  static String  getSecret(int type){
        String adid="2598C778FDB9B33F";
        if(BuildConfig.APPLICATION_ID.equals(APPTYPE.WUKONG)){
            adid="2598C778FDB9B33F";
        } else if (BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.CC)) {
            adid="9B09CA5C51B20771";
        }else if(BuildConfig.APPLICATION_ID.equals(AppUtils.APPTYPE.BILL)) {
            adid="";//未申请
        }


        return adid;
    }

    public static  class APPTYPE{
        public static String WUKONG="com.wkbb.wukong";
        public static String CC="com.wkbb.cc";
        public static String BILL="com.fuyu.wk.bill";

    }
}
